import { Column,Entity, ManyToOne, JoinColumn } from "typeorm";
import { Base } from "libs/Entities/base.entity";
import { Web_classify } from "./web-classify";
import { Exclude } from "class-transformer";
@Entity()
export class Web_link extends Base{
    @Column({
        comment: '名称'
    })
    title: string;

    @Column({
        default: 'www.baidu.com',
        comment: '链接'
    })
    link: string;

    @Column({
        default: '',
        comment: '描述'
    })
    describe: string;

    @Column({
        default: null,
        comment: '图片'
    })
    image: string;

    @ManyToOne(() => Web_classify, (category) => category.links,{
        onDelete:"SET NULL"
    })
    @JoinColumn({name: "classify_id"})
    category: Web_classify;

    
}
